package bank.driver.sockets;

import java.io.IOException;
import java.net.UnknownHostException;

import bank.Bank;
import bank.BankDriver;

public class SocketDriver implements BankDriver {
	
	private Bank bank;

	@Override
	public void connect(String[] args) throws NumberFormatException, UnknownHostException, IOException {
		this.bank = new SocketBank(
			new SocketMessenger(args[0], Integer.parseInt(args[1]))
		);
	}

	@Override
	public void disconnect() {
		this.bank = null;
	}

	@Override
	public Bank getBank() {
		return this.bank;
	}

}
